Page({
    data: {
        top: 0
    },

    onLoad() {
        const rect = wx.getMenuButtonBoundingClientRect()
        const xxx = wx.getSystemInfoSync()
        this.setData({
            top: rect.top
        })
        console.log('rect.top', rect.top) // 胶囊距离最顶部的距离
        console.log('xxx.statusBarHeight', xxx.statusBarHeight) // 状态栏的高度
        // 这两个距离相差 4px 
    }
})